package vn.gq.tym.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;


public class ViewPager extends android.support.v4.view.ViewPager {

	private boolean enabled = true;
	
	public ViewPager(Context context, AttributeSet attrs) {
		super(context, attrs);
	}
	
	public void setPagingEnable(boolean enabled) {
		this.enabled = enabled;
	}

	@Override
	public boolean onInterceptTouchEvent(MotionEvent event) {
		if (enabled) return super.onInterceptTouchEvent(event);
		return false;
	}

	@Override
	public boolean onTouchEvent(MotionEvent event) {
		if (enabled) return super.onTouchEvent(event);
		return false;
	}

}
